package org.springblade.modules.admin.controller.feishu;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.modules.admin.dto.PartsWorkSaveDTO;
import org.springblade.modules.admin.dto.UpdateBitableDataDTO;
import org.springblade.modules.admin.service.feishu.IFeiShuPartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Sharry
 * @createTime: 2024-02-02 13:27
 * @version: Version-1.0
 */

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/admin/feishu/parts")
@Api(value = "/admin/feishu/parts", tags = "飞书配件表")
public class FeiShuPartsController {

	@Autowired
	private IFeiShuPartsService feiShuPartsService;

	/**
	 * 2024-12-20 此接口已废弃，不再使用
	 */
	@Deprecated
	@PostMapping("/addPartsMessage")
	public void addPartsMessage(@RequestBody PartsWorkSaveDTO dto) {
		log.info("添加配件到飞书, 请求体:{}", dto);
		feiShuPartsService.addPartsMessage(dto);
	}

	@PostMapping("updateBitableByPlanId")
	public void updateBitableByPlanId(@RequestBody UpdateBitableDataDTO dto) {
		feiShuPartsService.updateBitableByPlanId(dto);
	}

}
